<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

//登录相关的路由
Route::get('admin/login','Admin\LoginController@index');

//登录处理路由
Route::post('admin/dologin','Admin\LoginController@dologin');


Route::post('admin/upload','Admin\ArticleController@upload');
Route::group(['prefix'=>'admin','namespace'=>'Admin','middleware'=>'admin.login'],function(){
	//后台首页路由
	Route::get('/','IndexController@index');
	//后台退出路由
	Route::get('quit','IndexController@quit');
	//用户模块
	Route::resource('user','UserController');
	//文章资源路由
	Route::resource('article','ArticleController');
	Route::post('upload','ArticleController@upload');
	Route::get('indexy','ArticleController@indexy');
	//文章分类模板
	Route::resource('cate','CateController');
	Route::post('cate/changeorder','CateController@changeOrder');
	//友情链接
	Route::resource('friend','FriendController');
	Route::post('friend/changeorder','FriendController@changeOrder');
});